[feature][pipeline] Support pipeline route params add database routing feature #2933#2947
Closed
icchux wants to merge 2 commits intoapache:masterfrom
icchux:master
Closed
[feature][pipeline] Support pipeline route params add database routing feature #2933#2947icchux wants to merge 2 commits intoapache:masterfrom icchux:master
icchux wants to merge 2 commits intoapache:masterfrom
icchux:master
Conversation
lvyanquan
reviewed
Jan 1, 2024
| replaceIdentifier = String.join(".", schemaRoute.f1, replaceTableName); | ||
| } | ||
|
|
||
| return recreateChangeEvent(changeEvent, TableId.parse(replaceIdentifier)); |
Contributor
There was a problem hiding this comment.
We can use new TableId(tableId.getSchemaName(), schemaRoute.f1, replaceTableName) to simplify the join and parse code.
Contributor
Author
There was a problem hiding this comment.
get. i will process it,but there only hava TableId.tableId() function can be use,it is ok?
// then schema route
for (Tuple4<String, String, String, String> schemaRoute : schemaRoutes) {
if (schemaRoute.f0.equals(tableId.getSchemaName())) {
// database routing, table add prefix and suffix mapping
TableId replaceBy;
String replaceTableName =
Optional.ofNullable(schemaRoute.f2).orElse("")
+ tableId.getTableName()
+ Optional.ofNullable(schemaRoute.f3).orElse("");
if (tableId.getNamespace() != null) {
replaceBy = TableId.tableId(tableId.getNamespace(),schemaRoute.f1, replaceTableName);
} else {
replaceBy = TableId.tableId(schemaRoute.f1, replaceTableName);
}
return recreateChangeEvent(changeEvent, replaceBy);
}
}
Contributor
There was a problem hiding this comment.
but there only hava TableId.tableId() function can be use,it is ok?
Yeah, This will be more concise.
Contributor
|
There is another pr #2908 provides a new idea, We can use placeholders to represent the original table name and database name, It‘s useful to add suffixes and suffixes while keeping parameters as before. |
Contributor
|
Closed by #3428 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the mapper parameter and prioritize using the Route rule for replacement. If a table does not specify a table rule, use the database rule for replacement